he R library for the Needleman-Wunsch algorithm

brary Biostrings in Bioconductor provides a function for

e Needleman-Wunsch algorithm to align two sequences. The

s named as pairwiseAlignment. Its format is shown below,

1 and s2 are two sequences, substitutionMatrix is a

substitution matrix, gapOpening is the penalty applied to an

gap and gapExtension is the penalty applied to extended

gaps.

seAlignment(s1,s2,substitutionMatrix,

gapOpening,gapExtension)

fine a sequence, Biostrings provides three functions. The

ing function is used to define a DNA sequence. The

ing function is used to define a RNA sequence. The AAString

is used to define an amino acid sequence. The following code can

o align two sequences,

tring('ABCNJRQCLCRPM')

tring('AJCJNRCKCRBP')

atrix(0,nrow=22,ncol=22)

ubs)=1

es(subs)=colnames(subs)=AA_ALPHABET[1:20]

seAlignment(s1,s2,substitutionMatrix=subs,

gapOpening=0,gapExtension=0)

lignment result for these two sequences is shown below,

RQCLCR-PM

| | || |

R-CKCRBP-